/**
 * 
 */
package com.zhiteng.entity;

import java.util.Date;


import com.fasterxml.jackson.annotation.JsonInclude;

/**  
* <p>Title: Bill.java</p>  
* <p>Description:请假/调课/代课单用于返回页面展示的实体 </p>  
* @author dragon  
* @date 2018年12月19日  
* @version 1.0  
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Bill implements Comparable<Bill>{
	private Date createDate; //	申请单的生成时间
	
	private Long id;
	private String teacherName;	//	申请教师名称
	private String teacherId;	//	申请教师id
	private String reason;	//	请假原因
	private Integer type;	//	请假的type=1,调课2，代课3
	private Integer status;	//	请假单状态：0.开始审批(审批中) 1.审批通过    2.审批不通过  3.消息推送申请人已确认     -1：已撤回（撤回删除tb_procins中记录，但不删除tb_leavebill中记录）
	private Integer revocable; // 是否可撤销，0-可撤销，1-不可撤销；默认值0，可撤销
	
	private String week;// 调课老师的星期几
	private Integer oldNode; // 调课老师的节次
	
	private String petitionerId;// 被请求老师的id
	private String petitionerName;// 被请求老师的姓名
	private String petitionerWeek;// 被调课老师的星期几
	private Integer courseNum; // 被调课老师的节次
	
	private Date adjustDate; // 调课日期
	private Date petitionerDate; // 被调课日期
	
	private Date start;	//	请假开始时间(只有请假用)
	private Date end;	//	请假结束时间(只有请假用)
	private Double hours;	//	请假时长(只有请假用)
	
	private Integer isAgree;	//	只有在我已确认中使用，用于标志已同意还是已拒绝。状态：0：已同意	 1：已拒绝 	
	
	
	public Integer getIsAgree() {
		return isAgree;
	}
	public void setIsAgree(Integer isAgree) {
		this.isAgree = isAgree;
	}
	public Bill() {
		super();
	}
	public Bill(Date createDate) {
		super();
		this.createDate = createDate;
	}
	
	
	public String getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(String teacherId) {
		this.teacherId = teacherId;
	}
	public String getPetitionerName() {
		return petitionerName;
	}
	public void setPetitionerName(String petitionerName) {
		this.petitionerName = petitionerName;
	}
	public String getPetitionerId() {
		return petitionerId;
	}
	public void setPetitionerId(String petitionerId) {
		this.petitionerId = petitionerId;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getTeacherName() {
		return teacherName;
	}
	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Integer getRevocable() {
		return revocable;
	}
	public void setRevocable(Integer revocable) {
		this.revocable = revocable;
	}
	public String getWeek() {
		return week;
	}
	public void setWeek(String week) {
		this.week = week;
	}
	public Integer getOldNode() {
		return oldNode;
	}
	public void setOldNode(Integer oldNode) {
		this.oldNode = oldNode;
	}
	public String getPetitionerWeek() {
		return petitionerWeek;
	}
	public void setPetitionerWeek(String petitionerWeek) {
		this.petitionerWeek = petitionerWeek;
	}
	public Integer getCourseNum() {
		return courseNum;
	}
	public void setCourseNum(Integer courseNum) {
		this.courseNum = courseNum;
	}
	public Date getAdjustDate() {
		return adjustDate;
	}
	public void setAdjustDate(Date adjustDate) {
		this.adjustDate = adjustDate;
	}
	public Date getPetitionerDate() {
		return petitionerDate;
	}
	public void setPetitionerDate(Date petitionerDate) {
		this.petitionerDate = petitionerDate;
	}
	public Date getStart() {
		return start;
	}
	public void setStart(Date start) {
		this.start = start;
	}
	public Date getEnd() {
		return end;
	}
	public void setEnd(Date end) {
		this.end = end;
	}
	public Double getHours() {
		return hours;
	}
	public void setHours(Double hours) {
		this.hours = hours;
	}

	@Override
	public int compareTo(Bill bill) {	//	按创建时间降序排列
		if(bill!=null && bill.getCreateDate()!=null) {
			if(bill.getCreateDate().getTime()-this.getCreateDate().getTime()>0) {
				return 1;
			}else if(bill.getCreateDate().getTime()-this.getCreateDate().getTime()<0) {
				return -1;
			}
			return 0;
		}
		return 0;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((adjustDate == null) ? 0 : adjustDate.hashCode());
		result = prime * result + ((courseNum == null) ? 0 : courseNum.hashCode());
		result = prime * result + ((createDate == null) ? 0 : createDate.hashCode());
		result = prime * result + ((end == null) ? 0 : end.hashCode());
		result = prime * result + ((hours == null) ? 0 : hours.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((isAgree == null) ? 0 : isAgree.hashCode());
		result = prime * result + ((oldNode == null) ? 0 : oldNode.hashCode());
		result = prime * result + ((petitionerDate == null) ? 0 : petitionerDate.hashCode());
		result = prime * result + ((petitionerId == null) ? 0 : petitionerId.hashCode());
		result = prime * result + ((petitionerName == null) ? 0 : petitionerName.hashCode());
		result = prime * result + ((petitionerWeek == null) ? 0 : petitionerWeek.hashCode());
		result = prime * result + ((reason == null) ? 0 : reason.hashCode());
		result = prime * result + ((revocable == null) ? 0 : revocable.hashCode());
		result = prime * result + ((start == null) ? 0 : start.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result + ((teacherId == null) ? 0 : teacherId.hashCode());
		result = prime * result + ((teacherName == null) ? 0 : teacherName.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		result = prime * result + ((week == null) ? 0 : week.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bill other = (Bill) obj;
		if (adjustDate == null) {
			if (other.adjustDate != null)
				return false;
		} else if (!adjustDate.equals(other.adjustDate))
			return false;
		if (courseNum == null) {
			if (other.courseNum != null)
				return false;
		} else if (!courseNum.equals(other.courseNum))
			return false;
		if (createDate == null) {
			if (other.createDate != null)
				return false;
		} else if (!createDate.equals(other.createDate))
			return false;
		if (end == null) {
			if (other.end != null)
				return false;
		} else if (!end.equals(other.end))
			return false;
		if (hours == null) {
			if (other.hours != null)
				return false;
		} else if (!hours.equals(other.hours))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (isAgree == null) {
			if (other.isAgree != null)
				return false;
		} else if (!isAgree.equals(other.isAgree))
			return false;
		if (oldNode == null) {
			if (other.oldNode != null)
				return false;
		} else if (!oldNode.equals(other.oldNode))
			return false;
		if (petitionerDate == null) {
			if (other.petitionerDate != null)
				return false;
		} else if (!petitionerDate.equals(other.petitionerDate))
			return false;
		if (petitionerId == null) {
			if (other.petitionerId != null)
				return false;
		} else if (!petitionerId.equals(other.petitionerId))
			return false;
		if (petitionerName == null) {
			if (other.petitionerName != null)
				return false;
		} else if (!petitionerName.equals(other.petitionerName))
			return false;
		if (petitionerWeek == null) {
			if (other.petitionerWeek != null)
				return false;
		} else if (!petitionerWeek.equals(other.petitionerWeek))
			return false;
		if (reason == null) {
			if (other.reason != null)
				return false;
		} else if (!reason.equals(other.reason))
			return false;
		if (revocable == null) {
			if (other.revocable != null)
				return false;
		} else if (!revocable.equals(other.revocable))
			return false;
		if (start == null) {
			if (other.start != null)
				return false;
		} else if (!start.equals(other.start))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (teacherId == null) {
			if (other.teacherId != null)
				return false;
		} else if (!teacherId.equals(other.teacherId))
			return false;
		if (teacherName == null) {
			if (other.teacherName != null)
				return false;
		} else if (!teacherName.equals(other.teacherName))
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		if (week == null) {
			if (other.week != null)
				return false;
		} else if (!week.equals(other.week))
			return false;
		return true;
	}
	

}
